$\newcommand{\R}{\mathbf{R}} \newcommand{\C}{\mathbf{C}} \newcommand{\A}{\mathcal{A}} \newcommand{\cF}{\mathcal{F}} \newcommand{\SPAN}{\text{span}} \newcommand{\B}{\mathcal{B}} \newcommand{\calL}{\mathcal{L}} \renewcommand{\u}{\mathbf{u}} \newcommand{\uu}{\mathbf{u}} \newcommand{\e}{\mathbf{e}} \newcommand{\vv}{\mathbf{v}} \newcommand{\w}{\mathbf{w}} \newcommand{\ww}{\mathbf{w}} \newcommand{\x}{\mathbf{x}} \newcommand{\xx}{\mathbf{x}} \newcommand{\y}{\mathbf{y}} \newcommand{\yy}{\mathbf{y}} \newcommand{\Cbar}{\overline{\mathbf{C}}} \newcommand{\Dbar}{\overline{\mathbf{D}}} \newcommand{\X}{\mathbf{X}} \newcommand{\Y}{\mathbf{Y}}$ \newcommand{\Xbar}{\widehat{\mathbf{X}}} \newcommand{\Ybar}{\widehat{\mathbf{Y}}} \newcommand{\zz}{\mathbf{z}} \renewcommand{\a}{\mathbf{a}} \renewcommand{\aa}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\cc}{\mathbf{c}} \newcommand{\ee}{\mathbf{e}} \newcommand{\hh}{\mathbf{h}} \newcommand{\m}{\mathbf{m}} \newcommand{\0}{\mathbf{0}} \newcommand{\ve}[1]{\mathbf{#1}} \newcommand{\col}[1]{\ifmmode\begin{bmatrix}#1\end{bmatrix}\else $\begin{bmatrix}#1\end{bmatrix}$\fi} \newcommand{\scol}[1]{\left[\begin{smallmatrix}#1\end{smallmatrix}\right]} \newcommand{\rref}{\operatorname{rref}} \newcommand{\hide}[1]{{}} \newcommand{\proj}{\operatorname{\mathbf{Proj}}} \newcommand{\Span}{\operatorname{span}} \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} \newcommand{\pdt}[2]{\tfrac{\partial #1}{\partial #2}} \newcommand{\pdd}[2]{\dfrac{\partial #1}{\partial #2}} \newcommand{\svdots}{\raisebox{3pt}{$\scalebox{.75}{\vdots}$}} \newcommand{\sddots}{\raisebox{3pt}{$\scalebox{.75}{$\ddots$}$}} \DeclareMathOperator{\Aut}{Aut} \DeclareMathOperator{\Char}{char} \DeclareMathOperator{\Cl}{Cl} \DeclareMathOperator{\codim}{codim} \DeclareMathOperator{\coker}{coker} \DeclareMathOperator{\disc}{disc} \DeclareMathOperator{\dist}{dist} \DeclareMathOperator{\Div}{Div} \DeclareMathOperator{\End}{End} \DeclareMathOperator{\Eth}{Eth} \DeclareMathOperator{\Frac}{Frac} \DeclareMathOperator{\Free}{Free} %\DeclareMathOperator{\frob}{frob} %\DeclareMathOperator{\Gal}{Gal} %\DeclareMathOperator{\genus}{genus} %\DeclareMathOperator{\Hecke}{Hecke} \DeclareMathOperator{\Hom}{Hom} %\DeclareMathOperator{\id}{id} %\DeclareMathOperator{\im}{im} \DeclareMathOperator{\lcm}{lcm} \DeclareMathOperator{\Mat}{Mat} \DeclareMathOperator{\modulo}{\medspace mod} \DeclareMathOperator{\Norm}{N} %\DeclareMathOperator{\nullity}{nullity} \DeclareMathOperator{\ord}{ord} \DeclareMathOperator{\Pic}{Pic} %\DeclareMathOperator{\rank}{rank} \DeclareMathOperator{\red}{red} \DeclareMathOperator{\res}{res} \DeclareMathOperator{\sgn}{sgn} %\DeclareMathOperator{\Span}{span} \DeclareMathOperator{\Spec}{Spec} \DeclareMathOperator{\Split}{Split} \DeclareMathOperator{\Sturm}{Sturm} \DeclareMathOperator{\Supp}{Supp} \DeclareMathOperator{\Tate}{Tate} \DeclareMathOperator{\tors}{tors} %\DeclareMathOperator{\tr}{tr} \DeclareMathOperator{\val}{val} \DeclareMathOperator{\Weil}{Weil} \DeclareMathOperator{\sech}{sech} \newcommand{\adjacent}{\leftrightarrow} \DeclareMathOperator{\GL}{GL} \DeclareMathOperator{\SL}{SL} \DeclareMathOperator{\PGL}{PGL} \DeclareMathOperator{\PSL}{PSL} \DeclareMathOperator{\SO}{SO} \newcommand{\cm}{\text{,}} %\newcommand{\pd}{\text{.}} \newcommand{\n}{\noindent} \newcommand{\Omicron}{\mathrm{O}} \newcommand{\Zeta}{\mathrm{Z}} \renewcommand{\div}{\mathop{\mathrm{div}}} \renewcommand{\Im}{\mathop{\mathrm{Im}}} \renewcommand{\Re}{\mathop{\mathrm{Re}}} \renewcommand{\ss}{\mathop{\mathrm{ss}}} \newcommand{\elliptic}{\mathop{\mathrm{ell}}} \newcommand{\new}{\mathop{\mathrm{new}}} \newcommand{\old}{\mathop{\mathrm{old}}} \newcommand{\Bs}{\boldsymbol} %\newcommand{\ds}{\displaystyle} %\newcommand{\f}{\mathfrak} \newcommand{\s}{\mathcal} %\newcommand{\A}{\mathbb{A}} %\newcommand{\C}{\mathbb{C}} \newcommand{\F}{\mathbb{F}} \newcommand{\Fpbar}{\bar{\mathbb{\F}}_p} \newcommand{\G}{\mathbb{G}} \newcommand{\Gm}{\mathbb{G}_{\mathrm{m}}} \newcommand{\N}{\mathbb{N}} \renewcommand{\P}{\mathbb{P}} \newcommand{\Q}{\mathbb{Q}} %\newcommand{\R}{\mathbb{R}} %\newcommand{\R}{\mathbf{R}} \newcommand{\T}{\mathbb{T}} \newcommand{\V}{\mathcal{V}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\E}{\mathbf{E}} \renewcommand{\H}{\mathrm{H}} \newcommand{\M}{\mathbf{M}} \renewcommand{\S}{\mathbf{S}} \newcommand{\var}{\mathbf{Var}} \newcommand{\eps}{\varepsilon} \newcommand{\erf}{\operatorname{erf}} \newcommand{\rar}{\rightarrow} \newcommand{\lar}{\leftarrow} \newcommand{\hrar}{\hookrightarrow} \renewcommand{\iff}{\Longleftrightarrow} \newcommand{\xrar}{\xrightarrow} \newcommand{\rrar}{\longrightarrow} \newcommand{\mt}{\mapsto} \newcommand{\mmt}{\longmapsto} \newcommand{\angles}[1]{\langle #1\rangle} \newcommand{\ceiling}[1]{\lceil #1\rceil} \newcommand{\floor}[1]{\lfloor #1\rfloor} \newcommand{\set}[2]{\{\,#1\,\,|\,\,#2\,\}} \renewcommand{\emph}{\it} \renewcommand{\em}{\emph} $\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}$

Chapter 23

Visualizing heat, wave, and damped wave equations on a bounded interval with Dirichlet boundary values.

Comparison of heat and wave equations with vanishing Dirichlet boundary conditions.

The heat equation $\dfrac{\partial u}{\partial t} = \dfrac{\partial^2 u}{\partial x^2}$ on $[0,L]$ with vanishing Dirichlet boundary values $u(t,0)= 0 = u(t,L)$ and initial condition $u(0,x) = f(x)$ has a unique solution, given by the infinite series $$u(t,x) = \sum_{n=1}^\infty B_n e^{-(n^2\pi^2/L^2)t} \sin\left(\frac{n\pi}{L}x\right)$$ with coefficients $$B_n = \frac 2L \int_0^L f(x) \sin\left(\frac{n\pi}{L}x\right) \, dx.$$

For general Dirichlet boundary values $U(t,0)=a$ and $U(t,L)=b$ and an initial condition $U(0,x) = F(x)$ (with $F(0)=a$, $F(L)=b$) the solution is $$ \left(a + \frac{(b-a)x}{L}\right) + \sum_{n=1}^\infty B_n e^{-(n^2\pi^2/L^2)t} \sin((n\pi/L)x) $$ for $B_n$'s defined using $f(x) = F(x) - (a + (b-a)x/L)$ in the integrals.

A solution of the wave equation $\dfrac{\partial^2 u}{\partial t^2} = \dfrac{\partial^2 u}{\partial x^2}$ on $[0,L]$ with vanishing Dirichlet boundary values and initial conditions $u(0,x) = f(x)$ and $(\partial u/\partial t)(0,x) = h(x)$ is given by $$u(t,x) = \sum_{n=1}^\infty (A_n \cos((n\pi/L)t) + B_n \sin((n\pi/L)t)) \sin((n\pi/L)x)$$ with $$A_n = \frac 2L \int_0^L f(x) \sin((n\pi/L)x) \, dx,$$ $$B_n = \frac{2}{n\pi} \int_0^L h(x) \sin((n\pi/L)x) \, dx.$$

For general boundary values $U(t,0)=a$ and $U(t,L)=b$ and initial conditions $U(0,x) = F(x)$ and $(\partial U/\partial t)(0,x)=H(x)$ (with $F(0)=a$, $F(L)=b$, and $H(0)=0=H(L)$) the solution is $$ \left(a + \frac{(b-a)x}{L}\right) + \sum_{n=1}^\infty (A_n \cos((n\pi/L)t) + B_n \sin((n\pi/L)t)) \sin((n\pi/L)x) $$ for the same $A_n$'s and $B_n$'s (using $h(x)=H(x)$ and $f(x) = F(x) - (a + (b-a)x/L)$ in the integrals).

Below is a visualization of solutions to the heat and wave equations $u_{\text{heat}}$ and $u_{\text{wave}}$ on $[0,\pi]$ with vanishing Dirichlet boundary conditions (so $L = \pi$). Pick initial conditions $u(0,x) = f(x)$ and $\dfrac{\partial u}{\partial t}(0,x) = h(x)$, and see how their long time behaviors differ. To see the decay of the heat equation solution more clearly, try running the animation with slower speeds (such as $1/10$-times as slow).

Initial Condition


For wave equation only:

Display Options


Speed: normal   x1/2     x1/5     x1/10    
Animation

Time: $t = $


Comparison of the damped and undamped wave equations.

The solutions of the wave equation as above are $2L$-periodic in time, so they oscillate forever without decay. But an actual vibrating string (for instance, in a guitar) does not go on periodically forever, in contrast with solutions to the wave equation. The point is that the wave equation is an idealized model that does not take friction into account. One way to incorporate friction is to add in a damping term inspired by our experience with damping for harmonic oscillators in our study of second-order linear ODE’s: the damped wave equation is $$\frac{\partial^2 u}{\partial t^2}(t,x) + k \frac{\partial u}{\partial t}(t,x) = \frac{\partial^2 u}{\partial x^2}(t,x),$$ where $k> 0$ is a constant quantifying the strength of the friction.

Provided that $k$ is small enough ($< 2\pi/L$, to be precise), separation of variables yields a general solution for the damped wave equation that has approximately the same form as when $k=0$. To be precise, the damped wave equation on $[0, L]$ with vanishing Dirichlet boundary values has general solution

$$u(t,x) = e^{-(k/2)t} \sum_{n=1}^\infty (A_n \cos(\omega_n t) + B_n \sin(\omega_n t)) \sin\left(\frac{n\pi}{L}x\right)$$ with $\omega_n = \sqrt{(n\pi/L)^2 - (k/2)^2}$. The exponential factor $e^{-(k/2)t}$ provides the desired decay over time when $k > 0$, and as $k \to 0$ the factor $\omega_n$ approaches $\sqrt{(n\pi/L)^2} = n\pi/L$ which appears in the general solution of the wave equation for the case $k=0$.

If we are given intial conditions $u(0,x) = f(x)$ and $(\partial u/\partial t)(0,x) = h(x)$, then $$A_n = \frac 2L \int_0^L f(x) \sin((n\pi/L)x) \, dx,$$ $$B_n = \frac{2}{L\omega_n} \int_0^L h(x) \sin((n\pi/L)x) \, dx + \frac{k}{2\omega_n} A_n.$$

Below is a visualization of solutions to the damped and umdamped wave equations $u_{\text{damped}}$ and $u_{\text{undamped}}$ on $[0,\pi]$ with vanishing Dirichlet boundary conditions (so $L = \pi$). Choose your desired damping $k$, pick initial conditions $u(0,x) = f(x)$ and $\dfrac{\partial u}{\partial t}(0,x) = h(x)$, and see how their long time behaviors differ. To see the decay of the damped wave equation solution more clearly, try running the animation with slower speeds (such as $1/10$-times as slow).

Damping


Initial Condition



Display Options


Speed: normal   x1/2     x1/5     x1/10    
Animation

Time: $t = $